< previous page page_216 next page >

Page 216
Tip.gif
Notice in the following code that you load the form (without showing it), set the values of the form's controls, and then show the form modally. This is a good way to pass parameters between formsload it, pass them, show it.

Private Sub cmdPrint_Click ()
   '
   ' load the next form
   Load frmReport
   '
   ' set values on the next form
   frmReport.txtReportDBName = "c:\tysdbvb5\source\data\Crysrpt.mdb"
   frmReport.txtReportName = "c:\tysdbvb5\source\chap06\comast1\comast1.rpt"
   frmReport.txtWindowTitle = "Company Master Report"   '
   ' show the form modally
   frmReport.Show 1
End Sub
Now save and run the project. You should see the Company Master Report dialog box prompting you to set parameters for your print job. (See Figure 6.24.)
0216-01.jpg
Figure 6.24.
Running the Company Master Report dialog box.
Not only have you finished a report routine for the CompanyMaster project you have been working on this week, but you now have the Print Report dialog box, which can be used in any future Visual Basic 5 project that uses the Crystal Reports Pro report writer.
Summary
Today you learned how to use the Crystal Reports Pro report writer to create a simple list report using the data tables you created earlier in the week. You also learned that Crystal Reports Pro is a banded report writer. Here are the main bands in a report:
· The header and footer bands: These bands appear on every page.
· The detail band: This band contains the equivalent of a data table record.
· The section band: This band contains subtotals or groupings of the data.

 
< previous page page_216 next page >

If you like this book, buy it!